/**
 * 分页摘要信息，包括页码，每页尺寸等
 */
package org.ewaf.framework.model;

import java.io.Serializable;

/**
 * @author peng.sunp
 * 
 */
public class PagingSummary implements Serializable {

	private static final long serialVersionUID = -2110412259521112137L;

	/**
	 * 页码
	 */
	private int start = 0;
	/**
	 * 单页尺寸
	 */
	private int limit = 10;
	/**
	 * 总条数
	 */
	private int total = 0;


	public int getLastPage() {
		if (this.total == 0) {
			return 1;
		}
		return this.total / this.limit + (this.total % this.limit == 0 ? 0 : 1);
	}

	public int getPage() {
		if(start==0)
		{
			return 1;
		}
		return this.start%this.limit;
	}


	public int getTotal() {
		return total;
	}

	public void setTotal(int total) {
		this.total = total;
	}

	public int getStart() {
		return start;
	}

	public void setStart(int start) {
		this.start = start;
	}

	public int getLimit() {
		return limit;
	}

	public void setLimit(int limit) {
		this.limit = limit;
	}

	
}
